[
  {
    "Plan": {
      "Node Type": "Sort",
      "Parallel Aware": false,
      "Startup Cost": 210.82,
      "Total Cost": 210.83,
      "Plan Rows": 2,
      "Plan Width": 80,
      "Actual Startup Time": 0.294,
      "Actual Total Time": 0.294,
      "Actual Rows": 2,
      "Actual Loops": 1,
      "Sort Key": ["s.country_id"],
      "Sort Method": "quicksort",
      "Sort Space Used": 25,
      "Sort Space Type": "Memory",
      "Plans": [
        {
          "Node Type": "Aggregate",
          "Strategy": "Sorted",
          "Partial Mode": "Simple",
          "Parent Relationship": "InitPlan",
          "Subplan Name": "CTE e_sum",
          "Parallel Aware": false,
          "Startup Cost": 199.52,
          "Total Cost": 199.58,
          "Plan Rows": 2,
          "Plan Width": 44,
          "Actual Startup Time": 0.113,
          "Actual Total Time": 0.115,
          "Actual Rows": 2,
          "Actual Loops": 1,
          "Group Key": ["p.country_id"],
          "Plans": [
            {
              "Node Type": "Sort",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Startup Cost": 199.52,
              "Total Cost": 199.53,
              "Plan Rows": 6,
              "Plan Width": 12,
              "Actual Startup Time": 0.107,
              "Actual Total Time": 0.108,
              "Actual Rows": 6,
              "Actual Loops": 1,
              "Sort Key": ["p.country_id"],
              "Sort Method": "quicksort",
              "Sort Space Used": 25,
              "Sort Space Type": "Memory",
              "Plans": [
                {
                  "Node Type": "Nested Loop",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Join Type": "Left",
                  "Startup Cost": 35.84,
                  "Total Cost": 199.44,
                  "Plan Rows": 6,
                  "Plan Width": 12,
                  "Actual Startup Time": 0.064,
                  "Actual Total Time": 0.101,
                  "Actual Rows": 6,
                  "Actual Loops": 1,
                  "Inner Unique": false,
                  "Plans": [
                    {
                      "Node Type": "Hash Join",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "Join Type": "Inner",
                      "Startup Cost": 3.41,
                      "Total Cost": 4.68,
                      "Plan Rows": 6,
                      "Plan Width": 12,
                      "Actual Startup Time": 0.054,
                      "Actual Total Time": 0.065,
                      "Actual Rows": 6,
                      "Actual Loops": 1,
                      "Inner Unique": true,
                      "Hash Cond": "(egc.pve_group_id = eg.id)",
                      "Plans": [
                        {
                          "Node Type": "Hash Join",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Join Type": "Inner",
                          "Startup Cost": 2.36,
                          "Total Cost": 3.58,
                          "Plan Rows": 6,
                          "Plan Width": 12,
                          "Actual Startup Time": 0.031,
                          "Actual Total Time": 0.040,
                          "Actual Rows": 6,
                          "Actual Loops": 1,
                          "Inner Unique": true,
                          "Hash Cond": "(c_1.player_id = p.id)",
                          "Plans": [
                            {
                              "Node Type": "Hash Join",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": false,
                              "Join Type": "Inner",
                              "Startup Cost": 1.14,
                              "Total Cost": 2.33,
                              "Plan Rows": 6,
                              "Plan Width": 16,
                              "Actual Startup Time": 0.015,
                              "Actual Total Time": 0.022,
                              "Actual Rows": 6,
                              "Actual Loops": 1,
                              "Inner Unique": false,
                              "Hash Cond": "(c_1.id = egc.character_id)",
                              "Plans": [
                                {
                                  "Node Type": "Seq Scan",
                                  "Parent Relationship": "Outer",
                                  "Parallel Aware": false,
                                  "Relation Name": "characters",
                                  "Alias": "c_1",
                                  "Startup Cost": 0.00,
                                  "Total Cost": 1.10,
                                  "Plan Rows": 10,
                                  "Plan Width": 16,
                                  "Actual Startup Time": 0.002,
                                  "Actual Total Time": 0.004,
                                  "Actual Rows": 10,
                                  "Actual Loops": 1
                                },
                                {
                                  "Node Type": "Hash",
                                  "Parent Relationship": "Inner",
                                  "Parallel Aware": false,
                                  "Startup Cost": 1.06,
                                  "Total Cost": 1.06,
                                  "Plan Rows": 6,
                                  "Plan Width": 16,
                                  "Actual Startup Time": 0.006,
                                  "Actual Total Time": 0.006,
                                  "Actual Rows": 6,
                                  "Actual Loops": 1,
                                  "Hash Buckets": 1024,
                                  "Original Hash Buckets": 1024,
                                  "Hash Batches": 1,
                                  "Original Hash Batches": 1,
                                  "Peak Memory Usage": 9,
                                  "Plans": [
                                    {
                                      "Node Type": "Seq Scan",
                                      "Parent Relationship": "Outer",
                                      "Parallel Aware": false,
                                      "Relation Name": "pve_groups_characters",
                                      "Alias": "egc",
                                      "Startup Cost": 0.00,
                                      "Total Cost": 1.06,
                                      "Plan Rows": 6,
                                      "Plan Width": 16,
                                      "Actual Startup Time": 0.003,
                                      "Actual Total Time": 0.004,
                                      "Actual Rows": 6,
                                      "Actual Loops": 1
                                    }
                                  ]
                                }
                              ]
                            },
                            {
                              "Node Type": "Hash",
                              "Parent Relationship": "Inner",
                              "Parallel Aware": false,
                              "Startup Cost": 1.10,
                              "Total Cost": 1.10,
                              "Plan Rows": 10,
                              "Plan Width": 12,
                              "Actual Startup Time": 0.010,
                              "Actual Total Time": 0.010,
                              "Actual Rows": 10,
                              "Actual Loops": 1,
                              "Hash Buckets": 1024,
                              "Original Hash Buckets": 1024,
                              "Hash Batches": 1,
                              "Original Hash Batches": 1,
                              "Peak Memory Usage": 9,
                              "Plans": [
                                {
                                  "Node Type": "Seq Scan",
                                  "Parent Relationship": "Outer",
                                  "Parallel Aware": false,
                                  "Relation Name": "players",
                                  "Alias": "p",
                                  "Startup Cost": 0.00,
                                  "Total Cost": 1.10,
                                  "Plan Rows": 10,
                                  "Plan Width": 12,
                                  "Actual Startup Time": 0.002,
                                  "Actual Total Time": 0.005,
                                  "Actual Rows": 10,
                                  "Actual Loops": 1
                                }
                              ]
                            }
                          ]
                        },
                        {
                          "Node Type": "Hash",
                          "Parent Relationship": "Inner",
                          "Parallel Aware": false,
                          "Startup Cost": 1.02,
                          "Total Cost": 1.02,
                          "Plan Rows": 2,
                          "Plan Width": 12,
                          "Actual Startup Time": 0.008,
                          "Actual Total Time": 0.008,
                          "Actual Rows": 2,
                          "Actual Loops": 1,
                          "Hash Buckets": 1024,
                          "Original Hash Buckets": 1024,
                          "Hash Batches": 1,
                          "Original Hash Batches": 1,
                          "Peak Memory Usage": 9,
                          "Plans": [
                            {
                              "Node Type": "Seq Scan",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": false,
                              "Relation Name": "pve_groups",
                              "Alias": "eg",
                              "Startup Cost": 0.00,
                              "Total Cost": 1.02,
                              "Plan Rows": 2,
                              "Plan Width": 12,
                              "Actual Startup Time": 0.004,
                              "Actual Total Time": 0.005,
                              "Actual Rows": 2,
                              "Actual Loops": 1,
                              "Filter": "(id IS NOT NULL)",
                              "Rows Removed by Filter": 0
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Node Type": "Limit",
                      "Parent Relationship": "Inner",
                      "Parallel Aware": false,
                      "Startup Cost": 32.44,
                      "Total Cost": 32.44,
                      "Plan Rows": 1,
                      "Plan Width": 32,
                      "Actual Startup Time": 0.005,
                      "Actual Total Time": 0.005,
                      "Actual Rows": 0,
                      "Actual Loops": 6,
                      "Plans": [
                        {
                          "Node Type": "Sort",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Startup Cost": 32.44,
                          "Total Cost": 32.44,
                          "Plan Rows": 1,
                          "Plan Width": 32,
                          "Actual Startup Time": 0.004,
                          "Actual Total Time": 0.004,
                          "Actual Rows": 0,
                          "Actual Loops": 6,
                          "Sort Key": ["db.oreder_num DESC"],
                          "Sort Method": "quicksort",
                          "Sort Space Used": 25,
                          "Sort Space Type": "Memory",
                          "Plans": [
                            {
                              "Node Type": "Hash Join",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": false,
                              "Join Type": "Inner",
                              "Startup Cost": 1.14,
                              "Total Cost": 32.43,
                              "Plan Rows": 1,
                              "Plan Width": 32,
                              "Actual Startup Time": 0.001,
                              "Actual Total Time": 0.001,
                              "Actual Rows": 0,
                              "Actual Loops": 6,
                              "Inner Unique": false,
                              "Hash Cond": "(egb.boss_id = db.boss_id)",
                              "Plans": [
                                {
                                  "Node Type": "Seq Scan",
                                  "Parent Relationship": "Outer",
                                  "Parallel Aware": false,
                                  "Relation Name": "pve_groups_bosses",
                                  "Alias": "egb",
                                  "Startup Cost": 0.00,
                                  "Total Cost": 31.25,
                                  "Plan Rows": 8,
                                  "Plan Width": 4,
                                  "Actual Startup Time": 0.000,
                                  "Actual Total Time": 0.000,
                                  "Actual Rows": 0,
                                  "Actual Loops": 6,
                                  "Filter": "(pve_group_id = eg.id)",
                                  "Rows Removed by Filter": 0
                                },
                                {
                                  "Node Type": "Hash",
                                  "Parent Relationship": "Inner",
                                  "Parallel Aware": false,
                                  "Startup Cost": 1.06,
                                  "Total Cost": 1.06,
                                  "Plan Rows": 6,
                                  "Plan Width": 6,
                                  "Actual Startup Time": 0.000,
                                  "Actual Total Time": 0.000,
                                  "Actual Rows": 0,
                                  "Actual Loops": 0,
                                  "Plans": [
                                    {
                                      "Node Type": "Seq Scan",
                                      "Parent Relationship": "Outer",
                                      "Parallel Aware": false,
                                      "Relation Name": "dungeons_bosses",
                                      "Alias": "db",
                                      "Startup Cost": 0.00,
                                      "Total Cost": 1.06,
                                      "Plan Rows": 6,
                                      "Plan Width": 6,
                                      "Actual Startup Time": 0.000,
                                      "Actual Total Time": 0.000,
                                      "Actual Rows": 0,
                                      "Actual Loops": 0
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "Node Type": "Aggregate",
          "Strategy": "Sorted",
          "Partial Mode": "Simple",
          "Parent Relationship": "InitPlan",
          "Subplan Name": "CTE p_sum",
          "Parallel Aware": false,
          "Startup Cost": 4.51,
          "Total Cost": 4.55,
          "Plan Rows": 2,
          "Plan Width": 44,
          "Actual Startup Time": 0.047,
          "Actual Total Time": 0.048,
          "Actual Rows": 1,
          "Actual Loops": 1,
          "Group Key": ["p_1.country_id"],
          "Plans": [
            {
              "Node Type": "Sort",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Startup Cost": 4.51,
              "Total Cost": 4.52,
              "Plan Rows": 2,
              "Plan Width": 12,
              "Actual Startup Time": 0.045,
              "Actual Total Time": 0.046,
              "Actual Rows": 2,
              "Actual Loops": 1,
              "Sort Key": ["p_1.country_id"],
              "Sort Method": "quicksort",
              "Sort Space Used": 25,
              "Sort Space Type": "Memory",
              "Plans": [
                {
                  "Node Type": "Nested Loop",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "Join Type": "Inner",
                  "Startup Cost": 2.24,
                  "Total Cost": 4.50,
                  "Plan Rows": 2,
                  "Plan Width": 12,
                  "Actual Startup Time": 0.037,
                  "Actual Total Time": 0.042,
                  "Actual Rows": 2,
                  "Actual Loops": 1,
                  "Inner Unique": true,
                  "Join Filter": "(pgc.pvp_group_id = pg.id)",
                  "Rows Removed by Join Filter": 3,
                  "Plans": [
                    {
                      "Node Type": "Hash Join",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "Join Type": "Inner",
                      "Startup Cost": 2.24,
                      "Total Cost": 3.40,
                      "Plan Rows": 2,
                      "Plan Width": 12,
                      "Actual Startup Time": 0.031,
                      "Actual Total Time": 0.034,
                      "Actual Rows": 2,
                      "Actual Loops": 1,
                      "Inner Unique": false,
                      "Hash Cond": "(p_1.id = c_2.player_id)",
                      "Plans": [
                        {
                          "Node Type": "Seq Scan",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Relation Name": "players",
                          "Alias": "p_1",
                          "Startup Cost": 0.00,
                          "Total Cost": 1.10,
                          "Plan Rows": 10,
                          "Plan Width": 12,
                          "Actual Startup Time": 0.003,
                          "Actual Total Time": 0.004,
                          "Actual Rows": 10,
                          "Actual Loops": 1
                        },
                        {
                          "Node Type": "Hash",
                          "Parent Relationship": "Inner",
                          "Parallel Aware": false,
                          "Startup Cost": 2.21,
                          "Total Cost": 2.21,
                          "Plan Rows": 2,
                          "Plan Width": 16,
                          "Actual Startup Time": 0.019,
                          "Actual Total Time": 0.019,
                          "Actual Rows": 2,
                          "Actual Loops": 1,
                          "Hash Buckets": 1024,
                          "Original Hash Buckets": 1024,
                          "Hash Batches": 1,
                          "Original Hash Batches": 1,
                          "Peak Memory Usage": 9,
                          "Plans": [
                            {
                              "Node Type": "Hash Join",
                              "Parent Relationship": "Outer",
                              "Parallel Aware": false,
                              "Join Type": "Inner",
                              "Startup Cost": 1.04,
                              "Total Cost": 2.21,
                              "Plan Rows": 2,
                              "Plan Width": 16,
                              "Actual Startup Time": 0.014,
                              "Actual Total Time": 0.018,
                              "Actual Rows": 2,
                              "Actual Loops": 1,
                              "Inner Unique": false,
                              "Hash Cond": "(c_2.id = pgc.character_id)",
                              "Plans": [
                                {
                                  "Node Type": "Seq Scan",
                                  "Parent Relationship": "Outer",
                                  "Parallel Aware": false,
                                  "Relation Name": "characters",
                                  "Alias": "c_2",
                                  "Startup Cost": 0.00,
                                  "Total Cost": 1.10,
                                  "Plan Rows": 10,
                                  "Plan Width": 16,
                                  "Actual Startup Time": 0.002,
                                  "Actual Total Time": 0.003,
                                  "Actual Rows": 10,
                                  "Actual Loops": 1
                                },
                                {
                                  "Node Type": "Hash",
                                  "Parent Relationship": "Inner",
                                  "Parallel Aware": false,
                                  "Startup Cost": 1.02,
                                  "Total Cost": 1.02,
                                  "Plan Rows": 2,
                                  "Plan Width": 16,
                                  "Actual Startup Time": 0.005,
                                  "Actual Total Time": 0.005,
                                  "Actual Rows": 2,
                                  "Actual Loops": 1,
                                  "Hash Buckets": 1024,
                                  "Original Hash Buckets": 1024,
                                  "Hash Batches": 1,
                                  "Original Hash Batches": 1,
                                  "Peak Memory Usage": 9,
                                  "Plans": [
                                    {
                                      "Node Type": "Seq Scan",
                                      "Parent Relationship": "Outer",
                                      "Parallel Aware": false,
                                      "Relation Name": "pvp_groups_characters",
                                      "Alias": "pgc",
                                      "Startup Cost": 0.00,
                                      "Total Cost": 1.02,
                                      "Plan Rows": 2,
                                      "Plan Width": 16,
                                      "Actual Startup Time": 0.003,
                                      "Actual Total Time": 0.004,
                                      "Actual Rows": 2,
                                      "Actual Loops": 1
                                    }
                                  ]
                                }
                              ]
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "Node Type": "Materialize",
                      "Parent Relationship": "Inner",
                      "Parallel Aware": false,
                      "Startup Cost": 0.00,
                      "Total Cost": 1.04,
                      "Plan Rows": 3,
                      "Plan Width": 8,
                      "Actual Startup Time": 0.002,
                      "Actual Total Time": 0.003,
                      "Actual Rows": 2,
                      "Actual Loops": 2,
                      "Plans": [
                        {
                          "Node Type": "Seq Scan",
                          "Parent Relationship": "Outer",
                          "Parallel Aware": false,
                          "Relation Name": "pvp_groups",
                          "Alias": "pg",
                          "Startup Cost": 0.00,
                          "Total Cost": 1.03,
                          "Plan Rows": 3,
                          "Plan Width": 8,
                          "Actual Startup Time": 0.002,
                          "Actual Total Time": 0.003,
                          "Actual Rows": 3,
                          "Actual Loops": 1,
                          "Filter": "(id IS NOT NULL)",
                          "Rows Removed by Filter": 0
                        }
                      ]
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "Node Type": "Aggregate",
          "Strategy": "Hashed",
          "Partial Mode": "Simple",
          "Parent Relationship": "InitPlan",
          "Subplan Name": "CTE total_sum",
          "Parallel Aware": false,
          "Startup Cost": 0.15,
          "Total Cost": 0.18,
          "Plan Rows": 2,
          "Plan Width": 68,
          "Actual Startup Time": 0.189,
          "Actual Total Time": 0.191,
          "Actual Rows": 2,
          "Actual Loops": 1,
          "Group Key": ["e.country_id"],
          "Plans": [
            {
              "Node Type": "Hash Join",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Join Type": "Left",
              "Startup Cost": 0.07,
              "Total Cost": 0.13,
              "Plan Rows": 2,
              "Plan Width": 20,
              "Actual Startup Time": 0.176,
              "Actual Total Time": 0.179,
              "Actual Rows": 2,
              "Actual Loops": 1,
              "Inner Unique": false,
              "Hash Cond": "(e.country_id = p_2.country_id)",
              "Plans": [
                {
                  "Node Type": "CTE Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "CTE Name": "e_sum",
                  "Alias": "e",
                  "Startup Cost": 0.00,
                  "Total Cost": 0.04,
                  "Plan Rows": 2,
                  "Plan Width": 12,
                  "Actual Startup Time": 0.115,
                  "Actual Total Time": 0.117,
                  "Actual Rows": 2,
                  "Actual Loops": 1
                },
                {
                  "Node Type": "Hash",
                  "Parent Relationship": "Inner",
                  "Parallel Aware": false,
                  "Startup Cost": 0.04,
                  "Total Cost": 0.04,
                  "Plan Rows": 2,
                  "Plan Width": 12,
                  "Actual Startup Time": 0.050,
                  "Actual Total Time": 0.050,
                  "Actual Rows": 1,
                  "Actual Loops": 1,
                  "Hash Buckets": 1024,
                  "Original Hash Buckets": 1024,
                  "Hash Batches": 1,
                  "Original Hash Batches": 1,
                  "Peak Memory Usage": 9,
                  "Plans": [
                    {
                      "Node Type": "CTE Scan",
                      "Parent Relationship": "Outer",
                      "Parallel Aware": false,
                      "CTE Name": "p_sum",
                      "Alias": "p_2",
                      "Startup Cost": 0.00,
                      "Total Cost": 0.04,
                      "Plan Rows": 2,
                      "Plan Width": 12,
                      "Actual Startup Time": 0.049,
                      "Actual Total Time": 0.049,
                      "Actual Rows": 1,
                      "Actual Loops": 1
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "Node Type": "Hash Join",
          "Parent Relationship": "Outer",
          "Parallel Aware": false,
          "Join Type": "Inner",
          "Startup Cost": 0.07,
          "Total Cost": 6.51,
          "Plan Rows": 2,
          "Plan Width": 80,
          "Actual Startup Time": 0.267,
          "Actual Total Time": 0.286,
          "Actual Rows": 2,
          "Actual Loops": 1,
          "Inner Unique": false,
          "Hash Cond": "(c.id = s.country_id)",
          "Plans": [
            {
              "Node Type": "Seq Scan",
              "Parent Relationship": "Outer",
              "Parallel Aware": false,
              "Relation Name": "countries",
              "Alias": "c",
              "Startup Cost": 0.00,
              "Total Cost": 5.49,
              "Plan Rows": 249,
              "Plan Width": 16,
              "Actual Startup Time": 0.008,
              "Actual Total Time": 0.034,
              "Actual Rows": 249,
              "Actual Loops": 1
            },
            {
              "Node Type": "Hash",
              "Parent Relationship": "Inner",
              "Parallel Aware": false,
              "Startup Cost": 0.04,
              "Total Cost": 0.04,
              "Plan Rows": 2,
              "Plan Width": 68,
              "Actual Startup Time": 0.200,
              "Actual Total Time": 0.200,
              "Actual Rows": 2,
              "Actual Loops": 1,
              "Hash Buckets": 1024,
              "Original Hash Buckets": 1024,
              "Hash Batches": 1,
              "Original Hash Batches": 1,
              "Peak Memory Usage": 9,
              "Plans": [
                {
                  "Node Type": "CTE Scan",
                  "Parent Relationship": "Outer",
                  "Parallel Aware": false,
                  "CTE Name": "total_sum",
                  "Alias": "s",
                  "Startup Cost": 0.00,
                  "Total Cost": 0.04,
                  "Plan Rows": 2,
                  "Plan Width": 68,
                  "Actual Startup Time": 0.192,
                  "Actual Total Time": 0.195,
                  "Actual Rows": 2,
                  "Actual Loops": 1
                }
              ]
            }
          ]
        }
      ]
    },
    "Planning Time": 1.297,
    "Triggers": [
    ],
    "Execution Time": 0.476
  }
]
